{% extends "base.html" %}

{% block title %}
    系统登录
{% endblock %}

{% block head %}
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='BlueNileAamin/lib/bootstrap/css/bootstrap.css')}}">

    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='BlueNileAamin/stylesheets/theme.css')}}">
    <link rel="stylesheet" href="{{ url_for('static', filename='BlueNileAamin/lib/font-awesome/css/font-awesome.css')}}">

    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height: 300px;
            width: 800px;
            margin: 0px auto;
            margin-top: 1em;
        }

        .brand {
            font-family: georgia, serif;
        }

        .brand .first {
            color: #ccc;
            font-style: italic;
        }

        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

    <script type="text/javascript">
        function keyLogin() {
            if (event.keyCode == 13)   //回车键的键值为13
                $('#subtn').click();  //调用登录按钮的登录事件
        }

        $(function () {
            var loginFun = function () {
                var form = $('#form');
                if (form.form('validate')) {
                    $('#loginBtn').linkbutton('disable');
                    $.post('/base/syuser!doNotNeedSessionAndSecurity_login.action', form.serialize(), function (result) {
                        if (result.success) {
                            location.replace('/');
                        } else {
                            $.messager.alert('提示', result.msg, 'error', function () {
                                $('#loginBtn').linkbutton('enable');
                            });
                        }
                    }, 'json');
                }
            };

            $("#subtn").click(function () {
                loginFun();
            });
        });
    </script>
{% endblock %}

{% block body %}
<body>
    <div class="navbar">
        <div class="navbar-inner">
            <ul class="nav pull-right">
                <ul class="nav pull-right">
                </ul>
            </ul>
        </div>
    </div>

    <div class="row-fluid">
        <div class="block" style="margin-top: 80px">
            <p class="block-heading">登陆</p>
            <div class="block-body">
                <form action="" method="post" class="validate"
                      id="form">
                    <label>用户名</label>
                    <input type="text" name="data.loginname" class="span12">
                    <label>密码</label>
                    <input type="password" name="data.pwd" class="span12">
                    <button type="button" id="subtn" style="display: none;"></button>
                    <a href="#" onclick="$('#subtn').click();" class="btn btn-primary pull-right">登陆</a>
                    <div class="clearfix"></div>
                </form>
            </div>
        </div>
    </div>

    <script src="{{ url_for('static', filename='BlueNileAamin/lib/bootstrap/js/bootstrap.js')}}"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function () {
            $('.demo-cancel-click').click(function () {
                return false;
            });
        });
    </script>
</body>
{% endblock %}